package com.syan.learn.optimization.ch05.memorymodel;

import org.junit.Test;

public class TestStack2 {

	private int count = 0;
	public void recursion(long a,long b,long c){
		long d=0,e=0,f=0;
		count ++;
		recursion(a,b,c);
	}
	
	public static void main(String[] args) {
		TestStack2 testStack =new TestStack2();
		
		try {
			testStack.recursion(1,2,3);
			System.out.println(11);
		} catch (Exception e) {
			System.out.println("deep of stack is " +testStack.count);
			e.printStackTrace();
		}
	}
	
	@Test
	public void testStack(){
		try {
			recursion(1,2,3);
		} catch (Exception e) {
			System.out.println("deep of stack is " +count);
			e.printStackTrace();
		}
	}
}
